<?php

class profileController extends Controller{
    public function profiledata(){
        $profileModel = new profileModel();
        $id = isset($_GET['id'])?$_GET['id']:0;
        $profile = $profileModel->selectProfile($id);
        $this->assign('profile',$profile[0]);
        $type = $profileModel->selectType();
        $this->assign('type',$type);
        $this->display('profile.tpl');
    }
    public function modifyHeroInfo(){
        $profileModel = new profileModel();
        $rst = $profileModel->modifyHeroInfo($_GET['id'],$_POST,$_FILES);
        if($rst == true){
            $this->profiledata();
        }else{
            $this->profiledata();
        }
        // $this->assign('profile',$profile[0]);
        // $type = $profileModel->selectType();
        // $this->assign('type',$type);
        // $this->display('profile.tpl');
    }
}